extends Area2D

signal reset_player

@export var speed := 50.0
@export var start: Marker2D
@export var end: Marker2D
@export var damage := 1.0
@export var camera_shake_strength: float = 2.0

var tween := create_tween()

@onready var start_pos := start.position
@onready var end_pos := end.position


func _ready() -> void:
	add_to_group("mobs")
	show()
	position = start_pos
	tween.tween_property(self, "position", end_pos, start_pos.distance_to(end_pos) / speed)
	tween.tween_property(self, "position", start_pos, start_pos.distance_to(end_pos) / speed)
	tween.set_loops()


func _on_body_entered(_body: Node2D) -> void:
	emit_signal("reset_player")
